package com.thinkgem.jeesite.modules.qy.utils;

import java.util.HashMap;


import org.apache.shiro.session.Session;

public class GlobalSessionContext {
	private static HashMap<Object,Object> sessionMap = new HashMap<Object,Object>();

	public static synchronized void AddSession(Session session) {
		if (session != null) {
			sessionMap.put(session.getId(), session);
		}
	}

	public static synchronized void DelSession(Session session) {
		if (session != null) {
			sessionMap.remove(session.getId());
		}
	}

	public static synchronized Session getSession(String session_id) {
		if (session_id == null)
			return null;
		return (Session) sessionMap.get(session_id);
	}
}
